home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / ADDSTRL.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  979b  |  64 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8. ;
  9. ; AddStrl-    Unions into a set the characters in the string immediately
  10. ;        following the CALL.
  11. ;
  12. ; inputs:
  13. ;
  14. ;    ES:DI-  Points at the set (at its mask byte).
  15. ;
  16. ;
  17. ;
  18.         public    sl_AddStrl
  19. ;
  20. sl_AddStrl    proc    far
  21.         push    bp
  22.         mov    bp, sp
  23.         push    ds
  24.         push    es
  25.         push    ax
  26.         push    bx
  27.         push    cx
  28.         push    si
  29.                 push    di
  30. ;
  31.         mov    si, di
  32.         mov    ax, es
  33.         mov    ds, ax
  34.         les    di, 2[bp]
  35.         mov    al, 0
  36.         mov    cx, 0ffffh
  37.     repne    scasb
  38.         xchg    2[bp], di
  39. ;
  40.         mov    al, [si]        ;Get mask byte
  41.         add    si, 8            ;Skip to start of set
  42.         mov    bh, 0
  43.                 jmp    IntoLp
  44. BldLp:        or    [si][bx], al        ;Add to set
  45.         inc    di            ;Move on to next char.
  46. IntoLp:        mov    bl, es:[di]
  47.         cmp    bl, 0
  48.         jnz    BldLp
  49. ;
  50.         pop    di
  51.         pop    si
  52.         pop    cx
  53.         pop    bx
  54.         pop    ax
  55.         pop    es
  56.         pop    ds
  57.         pop    bp
  58.         ret
  59. sl_AddStrl    endp
  60. ;
  61. ;
  62. stdlib        ends
  63.         end
  64.